var productId = getQuery("productId");
window.onload = function () {
    showIdProduct()
}

function showIdProduct() {
        axios.get("/product/findById",{
        params:{
            productId
        }
    }).then(e => {
        var info = e.data;
        var str = "";
        var shopStr = "";
        str = `<img src="/productImage/${info.imgPath}">`;
        $("imgPath").innerHTML = str;
        $("nameSpan").innerHTML = info.name;
        $("priceSpan").innerHTML = info.price;
        $("addressSpan").innerHTML = info.factory;
        $("dateSpan").innerHTML = info.createDate;
        $("numSpan").innerHTML = info.sum + "件";
        shopStr = `<a href="/custom/shop.html?productId=${info.id}">购买`;
        $("shopDiv").innerHTML = shopStr;
    })
}

function returnIndex() {
    location.href = "/index.html"
}

